package cn.kingyang.yiyi.mvp.presenter;


import cn.kingyang.yiyi.mvp.model.bean.HomeInfo;
import cn.kingyang.yiyi.mvp.model.bean.HttpData;
import cn.kingyang.yiyi.mvp.model.biz.AppModel;
import cn.kingyang.yiyi.mvp.view.HomeView;
import io.reactivex.functions.Consumer;

/**
 * Created by Administrator on 2017/2/28.
 */

public class HomePresenter extends BasePresenter<HomeView>{
    private AppModel appModel;

    public HomePresenter() {
        appModel = new AppModel();
    }

    public void getHomeAction() {
        getView().showProgress();
        addDisposable(appModel.getHomeInfo(), new Consumer<HttpData<HomeInfo>>() {
            @Override
            public void accept(HttpData<HomeInfo> httpData) throws Exception {
                getView().doHomeInfo(httpData);
            }
        });
    }
}
